<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户组管理</title>
    <link href="/favicon.ico"   rel="shortcut"  />
    <link href="__PUBLIC__/wxCMS/css/bootstrap.min.css" rel="stylesheet">
    <link href="__PUBLIC__/wxCMS/css/bootstrap-table.css" rel="stylesheet">
    <link href="__PUBLIC__/wxCMS/css/ssi-uploader.min.css" rel="stylesheet">
    <link href="__PUBLIC__/wxCMS/css/styles.css" rel="stylesheet">
    <link href="__PUBLIC__/wxCMS/css/home.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="__PUBLIC__/wxCMS/js/html5shiv.js"></script>
    <script src="__PUBLIC__/wxCMS/js/respond.min.js"></script>
    <![endif]-->

</head>
<body>
<div style="width: 80%;margin: auto">
<form class="form-horizontal" role="form">
    <fieldset>
        <legend>账号信息</legend>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="name">用户名</label>
            <div class="col-sm-4">
                <input class="form-control" id="name" type="text" placeholder="请输入账号信息"/>
            </div>
            <label class="col-sm-2 control-label" for="password">密码</label>
            <div class="col-sm-4">
                <input class="form-control" id="password" type="password" placeholder="请输入密码"/>
            </div>
        </div>
    </fieldset>
    <fieldset>
        <legend>请选择用户组</legend>
        <div class="form-group">
            <label for="disabledSelect"  class="col-sm-2 control-label">用户组</label>
            <div class="col-sm-10">
                <select id="disabledSelect" class="form-control">
                    <option value="">请选择用户组</option>
                    <volist name="roue" id="vo">
                        <option value="{$vo['id']}">{$vo['title']}</option>
                    </volist>
                </select>
            </div>
        </div>
    </fieldset>
    <fieldset>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="btn btn-primary" id="save_user">添加</button>
            </div>
        </div>
    </fieldset>
</form>
</div>
</body>
<script src="__PUBLIC__/wxCMS/js/jquery-1.11.1.min.js"></script>
<script src="__PUBLIC__/wxCMS/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/wxCMS/js/bootstrap-table.js"></script>
<script src="__PUBLIC__/wxCMS/js/ssi-uploader.js" type="text/javascript"></script>
<script src="__PUBLIC__/wxCMS/js/layer.js" type="text/javascript"></script>
<script src="__PUBLIC__/wxCMS/js/user-action.js"></script>
<script>
    $('#save_user').click(function(){
        var name=$('#name').val();
        var password=$('#password').val();
        var disabledSelect=$('#disabledSelect').val();
        if(name==''||password==''||disabledSelect==''){
            layer.msg('还有未填写项,请检查！！');return;
        }
        $.post('{:U("add_user")}',{name:name,password:password,group_id:disabledSelect},function(resutl){
                if(!resutl.success){
                    layer.msg(resutl.message);return;
                }
            layer.msg('新增用户成功')
        })
    })
</script>
</html>